summaryrefslogtreecommitdiff
path: root/cfg/fish_prompt[s].fish
diff options
context:
space:
mode:
authorjStmaX! <87650746+jstmaxlol@users.noreply.github.com>2025-09-28 21:15:19 +0200
committerGitHub <noreply@github.com>2025-09-28 21:15:19 +0200
commitcfeff9f00556042b0ec0909d3a149bd72e94a94c (patch)
treef5fedab1bcff9c02d5a5c461fa10c173ec271e74 /cfg/fish_prompt[s].fish
parentc6b6a39e77fb7bb06a5fb47feec6518c876c6b3f (diff)
##
Diffstat (limited to 'cfg/fish_prompt[s].fish')
-rw-r--r--cfg/fish_prompt[s].fish30
1 files changed, 23 insertions, 7 deletions
diff --git a/cfg/fish_prompt[s].fish b/cfg/fish_prompt[s].fish
index af447ce..da0903a 100644
--- a/cfg/fish_prompt[s].fish
+++ b/cfg/fish_prompt[s].fish
@@ -1,17 +1,27 @@
# fish_prompt
function fish_prompt
- set -l user (set_color green)$USER(set_color white)"@"
+ set -l user $USER
set -l cwd $PWD
set -l home $HOME
if test "$cwd" = "$home"
- echo -e (set_color white)"("(set_color green)"$user"(set_color magenta)"~"(set_color white)")"(set_color normal)"\n⮞ "
+ # if in ~
+ echo -e (set_color red)"("(set_color white)"$user" \
+ (set_color red)"⮞"(set_color white)"⮞"(set_color red)"⮞" \
+ (set_color white)"~"(set_color red)")"(set_color normal)"\n⮞ "
+ # (max⮞⮞⮞~)
+ # ⮞
else if string match -q "$home/*" $cwd
set -l relative (string replace "$home/" "~/" $cwd)
- echo -e (set_color white)"("(set_color green)"$user"(set_color magenta)$relative(set_color white)")"(set_color normal)"\n⮞ "
- #echo -e "$user"(set_color green)$relative(set_color white)" => "
+ # if in a ~ subdir
+ echo -e (set_color red)"("(set_color white)"$user" \
+ (set_color red)"⮞"(set_color white)"⮞"(set_color red)"⮞" \
+ (set_color white)$relative(set_color red)")"(set_color normal)"\n⮞ "
else
- echo -e "$user"(set_color green)$cwd(set_color white)" => "
+ # if in any other dir
+ echo -e (set_color red)"("(set_color white)"$user" \
+ (set_color red)"⮞"(set_color white)"⮞"(set_color red)"⮞" \
+ (set_color white)$cwd(set_color red)")"(set_color normal)"\n⮞ "
end
end
@@ -21,14 +31,20 @@ function fish_right_prompt
# check for which color to use
if test $last_status -eq 0
- set color green
+ set color white
else
set color red
end
+ if test $color = "white"
+ set colorInverse red
+ else
+ set color white
+ end
+
# set date in dt
set dt $(date '+%Y-%m-%d %H:%M')
# print prompt
- echo -e (set_color white)"( "(set_color $color)"$last_status"(set_color white)" | "(set_color $color)"$dt"(set_color white)" )"
+ echo -e (set_color $colorInverse)"( "(set_color $color)"$last_status"(set_color white)" | "(set_color $color)"$dt"(set_color $colorInverse)" )"
end